<template>
  <div class="advisory">
      <div class="advisoryNavBar">
          <van-nav-bar title="资讯详情" left-arrow @click-left="goback">
          </van-nav-bar>
      </div>
      <div class="advisoryInfo" v-for="(advisory,adv) in advisory" :key="adv">
          <div class="advisoryInfoHand">
              <img :src="advisory.image">
          </div>
          <div class="advisoryInfoTitle">
              <span>{{advisory.title}}</span>
          </div>
          <div class="advisoryInfoTime">
              <span>{{advisory.createTime}}</span>
          </div>
          <div class="advisoryInfoBody">
              <p v-html="advisory.content"></p>
          </div>
      </div>
  </div>
</template>

<script>
import { shoppingService } from "@/api";
export default {
    name: "advisory",
    data(){
        return{
            advisory:[],
        }
    },
      created() {
        this.asgetInfoDetails();
    },
    methods:{
        goback(){
            this.$router.go(-1);
        },
// 获取咨询详情
      async asgetInfoDetails(){
      const { data } = await shoppingService.getInfoDetails(this.$route.query.id);
      console.log(data,"咨询详情")
      this.advisory = data;
    },
  }
}
</script>

<style scoped>
.advisoryInfo{
    margin-top: 10px;
}
.advisoryInfoHand{
    text-align: center;
}
.advisoryInfoHand img{
    width: 95%;
    height: 200px;
}
.advisoryInfoTitle{
    margin-left: 12px;
    margin-top: 18px;
}
.advisoryInfoTitle span{
    font-size:18px;
    font-family:PingFang SC;
    font-weight:bold;
    color:rgba(51,51,51,1);
    line-height:20px;
}
.advisoryInfoTime{
    margin-top: 15px;
    margin-left: 248px;
}
.advisoryInfoTime span{
    font-size:10px;
    font-family:PingFang SC;
    font-weight:500;
    color:rgba(169,174,192,1);
    line-height:18px;
}
.advisoryInfoBody{
    margin: 15px 24px;
}
.advisoryInfoBody p{
    font-size:14px;
    font-family:PingFang SC;
    font-weight:500;
    color:rgba(102,102,102,1);
}
</style>